<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ms</title>
</head>

<body>
<?php
class dbconn{
    var $dblink;

    function dbconn($dbname, $dbhost="localhost:8888", $dbuser="root", $dbpass="root"){
        $this->dblink = mysql_connect($dbhost,$dbuser, $dbpass);
        mysql_select_db($dbname);
    }
    function stresc($str){
        return mysql_real_escape_string($str);
    }

    function close(){
        mysql_close($this->dblink);
    }
}
class dbrs{
    var $rs;
    var $row;
    var $num;
    var $rows=array();

    function dbrs($sql,$ret){
    $ret=($ret==1)?"exeret":"exenr";
    $this->$ret($sql);
    }
    function exenr($sqlquery){
        mysql_query($sqlquery);
    }
    function exeret($sqlquery){
        $this->rs = mysql_query($sqlquery) or die(mysql_error());
        $this->num = mysql_num_rows($this->rs);
        while($row=mysql_fetch_array($this->rs)){ 
            $this->rows[] = $row;
        }

    }
}
?> 
</body>
</html>